from django.shortcuts import render


# Create your views here.
from shop_web.models import Goods


def html_url(request, web_name):
    gid = request.GET.get('gid', None)
    html_path = 'shop_web/' + web_name + '.html'
    detail = None

    if gid:
        detail = Goods.objects.get(id=gid)

    gds = Goods.objects.all()
    return render(request, html_path, {'goods': gds, 'detail': detail})
